package com.ctgu.蓝桥杯真题.B组2015;

/**
 * @author: Backdiy
 * @data: 2021/4/15 15:29
 * @desc:
 */
//100以外基本上数的立方各位相加基本不可能等于自身
public class 立方变自身2 {
    public static void main(String[] args) {
        int sum = 0;
        for (int i = 1; i < 100; i++) {
            int x= f(i * i * i);
            if (x==i){
                sum++;
            }
        }
        System.out.println(sum);
    }

    static int f(int i) {
        int x, sum = 0;
        while (i > 0) {
            x = i % 10;
            i /= 10;
            sum+=x;
        }
        return sum;
    }

}
